package cn.chenxiejia;

/**
 * @version : V1.0
 * @program: maven
 * @ClassName: AnnTest
 * @Description:
 * @Author: chenxiejia
 * @Date: 2022/2/9 10:34
 */
public class AnnTest {
    @ann1(name = "张三", sex = "男", age = 12)
    @ann1(name = "李四")
    public static void main(String[] args) {
        try {
            //注意后面的.value()
            var ann = AnnTest.class.getMethod("main", String[].class).getAnnotation(Anns.class).value();
            System.out.println(ann[0].name());
            System.out.println(ann[1].age());
            System.out.println(ann[1].name());
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }

    }
}
